import 'package:day_demo/src/square/square_heading_change_trace/widgets/org_square_heading_change_trace_card.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'kyy_org_square_heading_change_trace_logic.dart';

class KyyOrgSquareHeadingChangeTracePage extends StatefulWidget {
  const KyyOrgSquareHeadingChangeTracePage({super.key});

  @override
  State<KyyOrgSquareHeadingChangeTracePage> createState() =>
      _KyyOrgSquareHeadingChangeTracePageState();
}

class _KyyOrgSquareHeadingChangeTracePageState
    extends State<KyyOrgSquareHeadingChangeTracePage> {
  final logic = Get.put(KyyOrgSquareHeadingChangeTraceLogic());
  final state = Get.find<KyyOrgSquareHeadingChangeTraceLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        backgroundColor: Colors.white,
        title: const Text(
          '修改记录',
          textAlign: TextAlign.center,
        ),
      ),
      backgroundColor: const Color(0xffF5F8FE),
      body: GetBuilder<KyyOrgSquareHeadingChangeTraceLogic>(builder: (logic) {
        return Padding(
          padding: const EdgeInsets.fromLTRB(16, 12, 16, 12),
          child: ListView.separated(
            itemBuilder: (ctx, index) {
              return const OrgSquareHeadingChangeTraceCard();
            },
            separatorBuilder: (ctx, index) {
              return const Divider(
                height: 12,
                thickness: 12,
                color: Color(0xffF5F8FE),
              );
            },
            itemCount: 10,
          ),
        );
      }),
    );
  }

  @override
  void dispose() {
    Get.delete<KyyOrgSquareHeadingChangeTraceLogic>();
    super.dispose();
  }
}
